/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package exempleexception2;

class MonException extends Exception {
    MonException() {
        System.out.println("Je suis cree");
    }
}
/**
 *
 * @author pfares
 */
public class Main {
    static boolean  problem=true;

    static void methodeBasse() throws MonException {
        try {
            if (problem) throw new MonException();
            System.out.println("Pas de probleme 1");
        } finally {
            System.out.println("methode basse ... ici");
        }
    }
    static void methodeMoyenne() throws MonException {
        try {
            methodeBasse();
            System.out.println("Pas de probleme 2");
        } finally {
            System.out.println("Methode moyenne ... ici");
        }
    }

    static void methodeHaute() {
        try {
            methodeMoyenne();
            System.out.println("Pas de probleme 3");
        } catch (MonException e) {
            System.out.println("Atrraper l'exeption!!!!");
        }
    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        methodeHaute();
    }

}
